using UnityEngine;

public class AutomaticLODEnabler : MonoBehaviour
{
	private AutomaticLOD m_lod;

	private void Awake()
	{
		m_lod = GetComponent<AutomaticLOD>();
		m_lod.enabled = false;
	}

	private void OnBecameVisible()
	{
		if (m_lod.GetCurrentLODLevel() < 2)
		{
			m_lod.enabled = true;
		}
	}

	private void OnBecameInvisible()
	{
		m_lod.enabled = false;
	}
}
